Skip to content

feat(sbt): add SBT (Scala Build Tool) support#752

Open
randomBrainstormer wants to merge 1 commit intortk-ai:developfrom
randomBrainstormer:feat/sbt/add-sbt-scala-build-tool-support
Open

feat(sbt): add SBT (Scala Build Tool) support#752
randomBrainstormer wants to merge 1 commit intortk-ai:developfrom
randomBrainstormer:feat/sbt/add-sbt-scala-build-tool-support

Conversation

@randomBrainstormer
Copy link
Copy Markdown

@randomBrainstormer randomBrainstormer commented Mar 20, 2026

Summary

  • Adds rtk sbt test — ScalaTest output filtering with 90% token reduction (compact single-line on pass, failure details on fail)
  • Adds rtk sbt compile — strips SBT noise, keeps errors with 75% token reduction (source count + time on success)
  • Adds rtk sbt run — light filtering, strips SBT preamble, passes through program output
  • Adds rtk sbt <other> — passthrough for any unsupported subcommand

Implementation

Follows the established go_cmd.rs pattern:

  • lazy_static! regex for noise/summary/error line detection
  • crate::tee::tee_and_hint for full output recovery on failure
  • Exit code propagation for CI/CD compatibility
  • Discovery rules updated (src/discover/rules.rs) with 80% savings estimate

Test plan

  • 11 unit tests with token savings assertions (>=60% on test pass, >=40% on test fail, >=30% on compile error)
  • 3 real-output fixtures: sbt_test_pass.txt, sbt_test_fail.txt, sbt_compile_error.txt
  • cargo fmt --all --check — clean
  • cargo clippy --all-targets — clean
  • cargo test --all — 990 passed, 0 failed
  • Manual: rtk sbt test in a real Scala project — pending, will validate on a Scala workspace

Documentation

  • README.md — added rtk sbt to build commands section and command rewrite table
  • CHANGELOG.md — added entry under [Unreleased]

Signed-off-by: Ivan Severino 4858703+randomBrainstormer@users.noreply.github.com

@randomBrainstormer randomBrainstormer force-pushed the feat/sbt/add-sbt-scala-build-tool-support branch from fd6de19 to f6c44ec Compare March 20, 2026 16:32
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 20, 2026

CLA assistant check
All committers have signed the CLA.

@aeppling
Copy link
Copy Markdown
Contributor

Hey

We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes src/ from a flat layout into subfolders.

No logic changes — only file moves and import path updates.

What you need to do

Rebase your branch on develop when receiving this comment:

git fetch origin && git rebase origin/develop

Git detects renames automatically. If you get import conflicts, update the paths:

use crate::git;        // now: use crate::cmds::git::git;
use crate::tracking;   // now: use crate::core::tracking;
use crate::config;     // now: use crate::core::config;
use crate::init;       // now: use crate::hooks::init;
use crate::gain;       // now: use crate::analytics::gain;

Need help rebasing? Tag @aeppling

Adds `rtk sbt` command with three subcommands:

- `rtk sbt test`    — ScalaTest output filtering (90% token reduction):
                      compact single-line on pass, failure details on fail
- `rtk sbt compile` — Strips SBT noise, keeps errors (75% token reduction):
                      success summary with source count + time
- `rtk sbt run`     — Light filtering, strips SBT preamble, keeps program output
- `rtk sbt <other>` — Passthrough for unsupported subcommands

Implementation follows the established go_cmd.rs pattern with lazy_static
regex, tee output recovery on failure, and exit code propagation for CI/CD.

Includes 3 real-output fixtures (pass, fail, compile error) and 11 unit tests
with token savings assertions. Discovery rules updated with 80% savings estimate.

Signed-off-by: Ivan Severino <4858703+randomBrainstormer@users.noreply.github.com>
@randomBrainstormer randomBrainstormer force-pushed the feat/sbt/add-sbt-scala-build-tool-support branch from f6c44ec to c985d7b Compare March 28, 2026 18:00
@randomBrainstormer
Copy link
Copy Markdown
Author

Hey, thanks for the heads-up! @aeppling , I've rebased on develop and adapted to the new structure. Let me know if anything looks off!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants